//
//  WBN_FM_MoreTableViewCell.m
//  GoodManNews
//
//  Created by 王博男 on 16/1/13.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "WBN_FM_MoreTableViewCell.h"
#import "Masonry.h"

@interface WBN_FM_MoreTableViewCell ()

@property (nonatomic, retain) UIImageView *playImageV;
@property (nonatomic, retain) UIImageView *rightImageV;

@end

@implementation WBN_FM_MoreTableViewCell


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self createView];
    }
    return self;
}

- (void)createView
{
    self.imageV = [UIImageView new];
    [self.contentView addSubview:self.imageV];
    
    
    self.playImageV = [UIImageView new];
    self.playImageV.image = [UIImage imageNamed:@"list_FM_playIcon@3x"];
    [self.imageV addSubview:self.playImageV];
    
    
    self.titleL = [UILabel new];
    self.titleL.textColor = [UIColor colorWithRed:0.076 green:0.007 blue:0.294 alpha:1.000];
    self.titleL.numberOfLines = 0;
    self.titleL.font = [UIFont systemFontOfSize:17];
    [self.contentView addSubview:self.titleL];
    
    
    self.detailL = [UILabel new];
    self.detailL.textColor = [UIColor lightGrayColor];
    self.detailL.numberOfLines = 0;
    self.detailL.font = [UIFont systemFontOfSize:14];
    [self.contentView addSubview:self.detailL];
    
    
    self.rightImageV = [UIImageView new];
    self.rightImageV.image = [UIImage imageNamed:@"list_FM_more@3x"];
    [self.contentView addSubview:self.rightImageV];
    
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    
    [self.imageV mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.contentView).offset(10);
        make.left.equalTo(self.contentView).offset(10);
        make.height.equalTo(@90);
        make.width.equalTo(@90);
        
    }];
    
    [self.playImageV mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.center.equalTo(self.imageV);
        make.height.equalTo(@30);
        make.width.equalTo(@30);
        
    }];
    
    [self.titleL mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.imageV.mas_top);
        make.left.equalTo(self.imageV.mas_right).with.offset(10);
        make.height.equalTo(@45);
        make.right.equalTo(self.contentView).offset(-40);
        
    }];
    
    [self.detailL mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.top.equalTo(self.titleL.mas_bottom);
        make.left.equalTo(self.titleL);
        make.height.equalTo(@[self.titleL]);
        make.width.equalTo(@[self.titleL]);
        
    }];
    
    [self.rightImageV mas_makeConstraints:^(MASConstraintMaker *make) {
       
        make.centerY.equalTo(self.contentView);
        make.left.equalTo(self.titleL.mas_right).with.offset(10);
        make.width.equalTo(@20);
        make.height.equalTo(@20);
        
    }];
}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
